package cn.hairui.blog.service.impl;

import cn.hairui.blog.model.Message;
import cn.hairui.blog.model.Messagereply;
import cn.hairui.blog.repository.MessageRepository;
import cn.hairui.blog.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * <h2>请添加说明
 * </h2>
 * <ol>请添加详细说明
 * </ol>
 *
 * <h2>修改历史
 * </h2>
 * <ol>如有修改，请添加修改历史
 * </ol>
 *
 * </p>
 *
 * @author laoganbu
 * @version V1.0
 * @date 2019/7/29 18:40
 */
@Service(value = "messageService")
public class MessageServiceImpl implements MessageService {

    @Autowired
    private MessageRepository messageRepository;

    @Override
    public List<Map> findLimited(String status, int count) {
        return messageRepository.findLimited(status, count);
    }

    @Override
    public List<Message> list() {
        return messageRepository.list();
    }

    @Override
    public List<Map> listMap() {
        return messageRepository.listMap();
    }

    @Override
    public Message find(int id) {
        return messageRepository.find(id);
    }

    @Override
    public void addReply(Messagereply messagereply) {
        messageRepository.addReply(messagereply);
    }

    @Override
    public void add(Message message) {
        messageRepository.add(message);
    }

    @Override
    public List<Map> listReply(int msgId) {
        return messageRepository.listReply(msgId);
    }

    @Override
    public Messagereply findReply(int id) {
        return messageRepository.findReply(id);
    }
}
